#include "Item.h"

namespace Xps
{

class EndItem : public Item
{
public:
	
	EndItem() : Item(XpsAssets::TreeNode::END)
	{
		color = Qt::darkGray;
		font.setPointSize(26);
		textFlags = Qt::AlignCenter;
		size.setWidth(32);
		size.setHeight(32);
	}

	void EndItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
	{
		painter->setClipRect(option->exposedRect);

		QPixmap question(":/rs/images/end.png");
		QRectF quadShape(QPointF(0,0),size);

		if (option->state & QStyle::State_MouseOver)
		{
			paintHoverRect(painter);
		}
		 if (option->state & QStyle::State_Selected)
		{
			paintSelectionRect(painter);
		}
		painter->drawPixmap(QRect(0, 0, size.width(), size.height()), question, QRect(0, 0, 64, 64));

		Item::paint(painter, option, widget);
	}
};

}